package com.hj.homework;

public class Test3 {
    public static void main(String[] args) {
        Person1[] person1={new Chinese(),new American(),new Indian()};
        for (Person1 person11 : person1) {
            person11.eat();
        }
    }
}
abstract class Person1{
    public abstract void eat();
}
class Chinese extends Person1{
    @Override
    public void eat() {
        System.out.println("用筷子吃饭");
    }
}
class American extends Person1{
    @Override
    public void eat() {
        System.out.println("用刀叉吃饭");
    }
}
class Indian extends Person1{
    @Override
    public void eat() {
        System.out.println("用手抓饭");
    }
}
